package com.zhl.media.app.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.zhl.media.app.model.OffLineData;
import com.zhl.media.app.model.Proj;
import com.zhl.media.app.mvp.contract.WorkTaskContract;
import com.zhl.media.app.mvp.model.api.service.AppService;
import com.zhl.media.commonsdk.base.BaseRespose;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;


@FragmentScope
public class WorkTaskModel extends BaseModel implements WorkTaskContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public WorkTaskModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }
    @Override
    public Observable<BaseRespose<OffLineData>> getListProj(String date) {
        return mRepositoryManager.obtainRetrofitService(AppService.class).getListProj(date);
    }

    @Override
    public Observable<BaseRespose<Map>> checkupdate() {
        return mRepositoryManager.obtainRetrofitService(AppService.class).checkupdate();
    }
}